package com.canvas.dto;

import lombok.Data;

import java.util.List;

/**
 * 通用多结果Service返回结构
 * @Author: 宗恣
 * @Date: 2018/9/4 0004 10:19
 */
@Data
public class ServiceMultiResult<T> {

    private long total;

    private List<T> result;

    public int getResultSize() {
        if (null == this.result) {
            return 0;
        }
        return this.result.size();
    }

    public ServiceMultiResult() {
    }

    public ServiceMultiResult(long total, List<T> result) {
        this.total = total;
        this.result = result;
    }
}
